package e_predicate;


import java.util.function.Predicate;

/*
    and()
 */
public class Demo02 {
    public static void method(String str, Predicate<String> pre1,Predicate<String> pre2){
        boolean b = pre1.and(pre2).test(str);
        System.out.println(b);
    }

    public static void main(String[] args) {
        method("迪丽热巴",
                s -> {return s.length() == 4;},
                s -> s.startsWith("迪")
        );
    }
}
